package com.scau.database.entity.stockbuyer;

import lombok.Data;

import java.math.BigDecimal;

/**
 * 对应http://localhost/#/order/create
 * 中的订购单列表中的元素
 */
@Data
public class OrderDTO {
        private Integer index;
        private String brand;
        private String commodity;
        private String bar_code;
        private BigDecimal unit_price;
        private Integer count;
        private Integer return_days;
        private Integer exchange_days;
        private Integer repair_days;
        private BigDecimal recommend_price;
        private BigDecimal max_price;
        private BigDecimal min_price;
        private Integer limit_buy;
        private String explain;

        public Integer getIndex() {
                return index;
        }

        public void setIndex(Integer index) {
                this.index = index;
        }

        public String getBrand() {
                return brand;
        }

        public void setBrand(String brand) {
                this.brand = brand;
        }

        public String getCommodity() {
                return commodity;
        }

        public void setCommodity(String commodity) {
                this.commodity = commodity;
        }

        public String getBar_code() {
                return bar_code;
        }

        public void setBar_code(String bar_code) {
                this.bar_code = bar_code;
        }

        public BigDecimal getUnit_price() {
                return unit_price;
        }

        public void setUnit_price(BigDecimal unit_price) {
                this.unit_price = unit_price;
        }

        public Integer getCount() {
                return count;
        }

        public void setCount(Integer count) {
                this.count = count;
        }

        public Integer getReturn_days() {
                return return_days;
        }

        public void setReturn_days(Integer return_days) {
                this.return_days = return_days;
        }

        public Integer getExchange_days() {
                return exchange_days;
        }

        public void setExchange_days(Integer exchange_days) {
                this.exchange_days = exchange_days;
        }

        public Integer getRepair_days() {
                return repair_days;
        }

        public void setRepair_days(Integer repair_days) {
                this.repair_days = repair_days;
        }

        public BigDecimal getRecommend_price() {
                return recommend_price;
        }

        public void setRecommend_price(BigDecimal recommend_price) {
                this.recommend_price = recommend_price;
        }

        public BigDecimal getMax_price() {
                return max_price;
        }

        public void setMax_price(BigDecimal max_price) {
                this.max_price = max_price;
        }

        public BigDecimal getMin_price() {
                return min_price;
        }

        public void setMin_price(BigDecimal min_price) {
                this.min_price = min_price;
        }

        public Integer getLimit_buy() {
                return limit_buy;
        }

        public void setLimit_buy(Integer limit_buy) {
                this.limit_buy = limit_buy;
        }

        public String getExplain() {
                return explain;
        }

        public void setExplain(String explain) {
                this.explain = explain;
        }

        /**
         * 计算总价
         * @return
         */
        public BigDecimal getSumaryPrice(){
                return unit_price.multiply(new BigDecimal(count));
        }
}
